package com.anuprayog.happypur;

import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Random;

import com.anuprayog.happypur.model.Angry;
import com.anuprayog.happypur.model.Bawling;
import com.anuprayog.happypur.model.Explosion;
import com.anuprayog.happypur.model.Happy;
import com.anuprayog.happypur.model.Sad;
import com.anuprayog.happypur.model.Teeth;
import com.anuprayog.happypur.model.Tongue;
import com.anuprayog.happypur.model.Wink;
import com.anuprayog.happypur.model.components.FastSpeed;
import com.anuprayog.happypur.model.components.Speed;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.media.MediaPlayer;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

/**
 * @author amit This is the main surface that handles the ontouch events and
 *         draws the images to the screen.
 */
public class MainGamePanel extends SurfaceView implements
		SurfaceHolder.Callback {

	public static String HIGH_SCORE = "com.anuprayog.happypur.SCORE";
	public static String SOUND_OFF_STRING = "com.anuprayog.happypur.SOUND";
	private static final float SPEED_INCREASE_FACTOR = (float) 4 / 3;
	
	private MainThread thread;
	public int score = 0;
	private int warned = 0;
	private String scoreString;
	private ArrayList<Happy> happyList = new ArrayList<Happy>();
	private ArrayList<Sad> sadList = new ArrayList<Sad>();
	private ArrayList<Angry> angryList = new ArrayList<Angry>();
	private ArrayList<Teeth> teethList = new ArrayList<Teeth>();
	private ArrayList<Wink> winkList = new ArrayList<Wink>();
	private ArrayList<Tongue> tongueList = new ArrayList<Tongue>();
	private ArrayList<Bawling> bawlingList = new ArrayList<Bawling>();

	private int cycle = 0;
	private int speedIncreaser = 0;
	private int speedVector;
	private float fastSpeed;
	private Explosion explosion;
	private ArrayList<Explosion> explosionList = new ArrayList<Explosion>();
	public boolean paused;
	private boolean restart;

	private Bitmap background = BitmapFactory.decodeResource(getResources(),
			R.drawable.grassb);
	private Bitmap woodBackground = BitmapFactory.decodeResource(
			getResources(), R.drawable.wood1);

	private Bitmap scorer = BitmapFactory.decodeResource(getResources(),
			R.drawable.score1);
	private Bitmap pause = BitmapFactory.decodeResource(getResources(),
			R.drawable.pausebutton1);
	private Bitmap resume = BitmapFactory.decodeResource(getResources(),
			R.drawable.resumebutton1);

	private Bitmap zero = BitmapFactory.decodeResource(getResources(),
			R.drawable.zero);
	private Bitmap one = BitmapFactory.decodeResource(getResources(),
			R.drawable.one);
	private Bitmap two = BitmapFactory.decodeResource(getResources(),
			R.drawable.two);
	private Bitmap three = BitmapFactory.decodeResource(getResources(),
			R.drawable.three);
	private Bitmap four = BitmapFactory.decodeResource(getResources(),
			R.drawable.four);
	private Bitmap five = BitmapFactory.decodeResource(getResources(),
			R.drawable.five);
	private Bitmap six = BitmapFactory.decodeResource(getResources(),
			R.drawable.six);
	private Bitmap seven = BitmapFactory.decodeResource(getResources(),
			R.drawable.seven);
	private Bitmap eight = BitmapFactory.decodeResource(getResources(),
			R.drawable.eight);
	private Bitmap nine = BitmapFactory.decodeResource(getResources(),
			R.drawable.nine);

	private MediaPlayer punch = MediaPlayer.create((Activity) getContext(),
			R.raw.punch);

	Intent i = ((Activity) getContext()).getIntent();
	Paint paint = new Paint();

	private String soundoff = i.getStringExtra(MainActivity.SOUND_ON_STRING);

	public MainGamePanel(Context context) {
		super(context);
		// adding the callback (this) to the surface holder to intercept events
		getHolder().addCallback(this);

		// create the game loop thread
		thread = new MainThread(getHolder(), this);

		// make the GamePanel focusable so it can handle events
		setFocusable(true);

	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {

		// if it is the first time the thread starts
		if (thread.getState() == Thread.State.NEW) {
			thread.setRunning(true);
			thread.start();
		}

		// after a pause it starts the thread again
		else if (thread.getState() == Thread.State.TERMINATED) {
			thread = new MainThread(getHolder(), this);
			thread.setRunning(true);
			thread.start(); // Start a new thread
			restart = true;
		}

		if (restart) {
			thread.setRunning(false);
			paused = true;
		}
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		// tell the thread to shut down and wait for it to finish
		// this is a clean shutdown
		boolean retry = true;
		while (retry) {
			try {
				thread.join();
				retry = false;
			} catch (InterruptedException e) {
				// try again shutting down the thread
			}
		}
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN) {
			// delegating event handling to the smilies giving score of 1 on
			// punching sad smilies and a warning on punching happy smilies

			int tx = (int) event.getX();
			int ty = (int) event.getY();

			// pause-resume function
			if (event.getX() < pause.getWidth()) {
				if (event.getY() < pause.getHeight()) {
					if (!paused) {
						thread.setRunning(false);
						paused = true;
					} else if (paused) {
						thread = new MainThread(getHolder(), this);
						thread.setRunning(true);
						thread.start();
						paused = false;
					}
				}
			}

			if (event.getY() > getHeight() / 8) {
				if (!paused) {
					// punch the sad smiley
					try {
						for (int i = 0; i < sadList.size(); i++) {
							sadList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (sadList.get(i).isTouched()) {
								int touchx = sadList.get(i).getX();
								int touchy = sadList.get(i).getY();
								if (tx < touchx
										+ (sadList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (sadList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (sadList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (sadList.get(i).getBitmap()
															.getHeight() / 2)) {
										score = score + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										sadList.remove(i);
									}
								}
							}
						}

						// punch the happy smiley
						for (int i = 0; i < happyList.size(); i++) {
							happyList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (happyList.get(i).isTouched()) {
								int touchx = happyList.get(i).getX();
								int touchy = happyList.get(i).getY();
								if (tx < touchx
										+ (happyList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (happyList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (happyList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (happyList.get(i).getBitmap()
															.getHeight() / 2)) {
										warned = warned + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										happyList.remove(i);
									}
								}
							}
						}

						// punch the angry smiley
						for (int i = 0; i < angryList.size(); i++) {
							angryList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (angryList.get(i).isTouched()) {
								int touchx = angryList.get(i).getX();
								int touchy = angryList.get(i).getY();
								if (tx < touchx
										+ (angryList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (angryList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (angryList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (angryList.get(i).getBitmap()
															.getHeight() / 2)) {
										score = score + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										angryList.remove(i);
									}
								}
							}
						}

						// punch the teeth smiley
						for (int i = 0; i < teethList.size(); i++) {
							teethList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (teethList.get(i).isTouched()) {
								int touchx = teethList.get(i).getX();
								int touchy = teethList.get(i).getY();
								if (tx < touchx
										+ (teethList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (teethList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (teethList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (teethList.get(i).getBitmap()
															.getHeight() / 2)) {
										warned = warned + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										teethList.remove(i);
									}
								}
							}
						}

						// punch the wink smiley
						for (int i = 0; i < winkList.size(); i++) {
							winkList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (winkList.get(i).isTouched()) {
								int touchx = winkList.get(i).getX();
								int touchy = winkList.get(i).getY();
								if (tx < touchx
										+ (winkList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (winkList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (winkList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (winkList.get(i).getBitmap()
															.getHeight() / 2)) {
										warned = warned + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										winkList.remove(i);
									}
								}
							}
						}

						// punch the tongue smiley
						for (int i = 0; i < tongueList.size(); i++) {
							tongueList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (tongueList.get(i).isTouched()) {
								int touchx = tongueList.get(i).getX();
								int touchy = tongueList.get(i).getY();
								if (tx < touchx
										+ (tongueList.get(i).getBitmap().getWidth() / 2)
										&& tx > touchx
												- (tongueList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (tongueList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (tongueList.get(i)
															.getBitmap()
															.getHeight() / 2)) {
										warned = warned + 1;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										tongueList.remove(i);
									}
								}
							}
						}

						// punch the bawling smiley
						for (int i = 0; i < bawlingList.size(); i++) {
							bawlingList.get(i).handleActionDown((int) event.getX(),
									(int) event.getY());
							if (bawlingList.get(i).isTouched()) {
								int touchx = bawlingList.get(i).getX();
								int touchy = bawlingList.get(i).getY();
								if (tx < touchx
										+ (bawlingList.get(i).getBitmap()
												.getWidth() / 2)
										&& tx > touchx
												- (bawlingList.get(i).getBitmap()
														.getWidth() / 2)) {
									if (ty < touchy
											+ (bawlingList.get(i).getBitmap()
													.getHeight() / 2)
											&& ty > touchy
													- (bawlingList.get(i)
															.getBitmap()
															.getHeight() / 2)) {
										score = score + 10;
										explosion = new Explosion(
												BitmapFactory.decodeResource(
														getResources(),
														R.drawable.explosion),
												touchx, touchy);
										explosionList.add(explosion);
										if (soundoff.equals("false")) {
											punch.start();
										}
										bawlingList.remove(i);
									}
								}
							}
						}
					} catch (IndexOutOfBoundsException e) {
					
					}
				}

				if (warned >= 1) {
					thread.setRunning(false);

					Intent intent = new Intent((Activity) getContext(),
							GameOverActivity.class);
					intent.putExtra(HIGH_SCORE, scoreString);
					intent.putExtra(SOUND_OFF_STRING, soundoff);
					((Activity) getContext()).startActivity(intent);
					((Activity) getContext()).finish();
				}
			}

		}
		if (event.getAction() == MotionEvent.ACTION_MOVE) {
		}
		if (event.getAction() == MotionEvent.ACTION_UP) {
			// touch was released
			if (event.getX() < pause.getWidth()) {
				if (event.getY() < pause.getHeight()) {
					if (!paused) {
						paused = false;
					} else if (paused) {
						paused = true;
					}
				}
			}

			for (int i = 0; i < sadList.size(); i++) {
				if (sadList.get(i).isTouched()) {
					sadList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < happyList.size(); i++) {
				if (happyList.get(i).isTouched()) {
					happyList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < angryList.size(); i++) {
				if (angryList.get(i).isTouched()) {
					angryList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < teethList.size(); i++) {
				if (teethList.get(i).isTouched()) {
					teethList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < winkList.size(); i++) {
				if (winkList.get(i).isTouched()) {
					winkList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < tongueList.size(); i++) {
				if (tongueList.get(i).isTouched()) {
					tongueList.get(i).setTouched(false);
				}
			}

			for (int i = 0; i < bawlingList.size(); i++) {
				if (bawlingList.get(i).isTouched()) {
					bawlingList.get(i).setTouched(false);
				}
			}

		}
		return true;
	}

	@Override
	protected void onDraw(Canvas canvas) {

		// set grass background
		float left = 0, top = getHeight() / 8;
		float bgTileWidth = background.getWidth();
		float bgTileHeight = background.getHeight();

		while (left < getWidth()) {
			while (top < getHeight()) {
				canvas.drawBitmap(background, left, top, null);
				top += bgTileHeight;
			}
			left += bgTileWidth;
			top = getHeight() / 8;
		}

		// fills the canvas with smilies
		try {
			for (int i = 0; i < happyList.size(); i++) {
				happyList.get(i).draw(canvas);
			}
			for (int i = 0; i < sadList.size(); i++) {
				sadList.get(i).draw(canvas);
			}
			for (int i = 0; i < angryList.size(); i++) {
				angryList.get(i).draw(canvas);
			}
			for (int i = 0; i < teethList.size(); i++) {
				teethList.get(i).draw(canvas);
			}
			for (int i = 0; i < winkList.size(); i++) {
				winkList.get(i).draw(canvas);
			}
			for (int i = 0; i < tongueList.size(); i++) {
				tongueList.get(i).draw(canvas);
			}
			for (int i = 0; i < bawlingList.size(); i++) {
				bawlingList.get(i).draw(canvas);
			}
			Iterator<Explosion> iter = explosionList.iterator();
			while (iter.hasNext()) {
				iter.next().draw(canvas);
			}

		} catch (IndexOutOfBoundsException e) {

		} catch (NullPointerException e) {

		}

		paint.setARGB(255, 255, 255, 255);

		// set wooden background on top
		float left1 = 0, top1 = 0;
		float bgTileWidth1 = woodBackground.getWidth();
		float bgTileHeight1 = woodBackground.getHeight();

		while (left1 < getWidth()) {
			while (top1 < getHeight() / 8) {
				canvas.drawBitmap(woodBackground, left1, top1, null);
				top1 += bgTileHeight1;
			}
			left1 += bgTileWidth1;
			top1 = 0;
		}

		paint.setTextSize(this.getHeight() / 10);

		// draw the pause and resume buttons
		if (!(MainThread.running)) {
			canvas.drawBitmap(resume, 0, 0, paint);
		} else if (MainThread.running) {
			canvas.drawBitmap(pause, 0, 0, paint);
		}

		// show score and warnings
		canvas.drawBitmap(scorer, this.getWidth() * (float) 0.7, 20, paint);

		scoreString = String.valueOf(score);

		// parsing score string to print score in the canvas
		if (scoreString.charAt(0) == '0') {
			canvas.drawBitmap(zero, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '1') {
			canvas.drawBitmap(one, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '2') {
			canvas.drawBitmap(two, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '3') {
			canvas.drawBitmap(three, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '4') {
			canvas.drawBitmap(four, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '5') {
			canvas.drawBitmap(five, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '6') {
			canvas.drawBitmap(six, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '7') {
			canvas.drawBitmap(seven, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '8') {
			canvas.drawBitmap(eight, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		} else if (scoreString.charAt(0) == '9') {
			canvas.drawBitmap(nine, this.getWidth() * (float) 0.85,
					this.getHeight() / 32, paint);
		}

		if (score > 9) {
			if (scoreString.charAt(1) == '0') {
				canvas.drawBitmap(zero, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '1') {
				canvas.drawBitmap(one, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '2') {
				canvas.drawBitmap(two, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '3') {
				canvas.drawBitmap(three, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '4') {
				canvas.drawBitmap(four, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '5') {
				canvas.drawBitmap(five, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '6') {
				canvas.drawBitmap(six, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '7') {
				canvas.drawBitmap(seven, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '8') {
				canvas.drawBitmap(eight, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(1) == '9') {
				canvas.drawBitmap(nine, this.getWidth() * (float) 0.9,
						this.getHeight() / 32, paint);
			}
		}

		if (score > 99) {
			if (scoreString.charAt(2) == '0') {
				canvas.drawBitmap(zero, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '1') {
				canvas.drawBitmap(one, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '2') {
				canvas.drawBitmap(two, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '3') {
				canvas.drawBitmap(three, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '4') {
				canvas.drawBitmap(four, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '5') {
				canvas.drawBitmap(five, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '6') {
				canvas.drawBitmap(six, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '7') {
				canvas.drawBitmap(seven, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '8') {
				canvas.drawBitmap(eight, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			} else if (scoreString.charAt(2) == '9') {
				canvas.drawBitmap(nine, this.getWidth() * (float) 0.95,
						this.getHeight() / 32, paint);
			}
		}

	}

	/**
	 * This is the game update method. It iterates through all the objects and
	 * calls their update method if they have one or calls specific engine's
	 * update method.
	 */
	public void update() {

		Random ran = new Random();
		int y;

		int z = getHeight();
		int z1 = 9 * (getHeight() / 16);

		int aa = getWidth();

		cycle = cycle + 1; // count update cycles

		// Increase speed after 2000 update cycles are completed
		if (cycle % 2000 == 0) {

			speedIncreaser = speedIncreaser + 1;

			try {
				for (int i = 0; i < happyList.size(); i++) {
					happyList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < sadList.size(); i++) {
					sadList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < angryList.size(); i++) {
					angryList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < teethList.size(); i++) {
					teethList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < winkList.size(); i++) {
					winkList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < tongueList.size(); i++) {
					tongueList.get(i).getSpeed().increaseSpeed();
				}
				for (int i = 0; i < bawlingList.size(); i++) {
					bawlingList.get(i).getFastSpeed().increaseSpeed();
				}
			} catch (NullPointerException e) {

			}
		}

		// generate smilies after 40 update cycles. increase generation if game
		// speed increases
		if (cycle % ((int) (40 / (speedIncreaser + 1))) == 0) {

			// remove particle explosions if any
			try {
				for (int i = 0; i < explosionList.size(); i++) {
					explosionList.remove(i);
				}
			} catch (NullPointerException e) {
			}

			// generate random smiley
			Random random = new Random();
			int gen;
			gen = random.nextInt(26);

			speedVector = aa / 80;

			float xve, xvel, yvel;

			// give the smiley a random speed with a sqrt(8) vector
			if (speedVector < 8) {
				xve = ((float) Math.random())
						* (float) ((Math.sqrt(speedVector)) - 1);
				xvel = xve + 1;
				yvel = (float) Math.sqrt(speedVector - (xvel * xvel));
				fastSpeed = (float) aa / 64;
			} else {
				xve = ((float) Math.random()) * (float) ((Math.sqrt(8)) - 1);
				xvel = xve + 1;
				yvel = (float) Math.sqrt(8 - (xvel * xvel));
				fastSpeed = 10;
			}

			y = ran.nextInt(z) + getHeight() / 8;

			if (y == 0) {
				y = z / 2;
			}

			if (gen == 0) {

				Happy happy = new Happy(BitmapFactory.decodeResource(
						getResources(), R.drawable.happy4), 0, y);
				happy.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happy.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happyList.add(happy);

			} else if (gen == 1) {

				Sad sad = new Sad(BitmapFactory.decodeResource(getResources(),
						R.drawable.sad4), 0, y);
				sad.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sad.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sadList.add(sad);

			} else if (gen == 2) {

				Angry angry = new Angry(BitmapFactory.decodeResource(
						getResources(), R.drawable.angry4), 0, y);
				angry.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angry.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angryList.add(angry);

			} else if (gen == 3) {

				Teeth teeth = new Teeth(BitmapFactory.decodeResource(
						getResources(), R.drawable.teeth4), 0, y);
				teeth.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teeth.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teethList.add(teeth);

			} else if (gen == 4) {

				Wink wink = new Wink(BitmapFactory.decodeResource(
						getResources(), R.drawable.wink4), 0, y);
				wink.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				wink.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				winkList.add(wink);

			} else if (gen == 5) {

				Tongue tongue = new Tongue(BitmapFactory.decodeResource(
						getResources(), R.drawable.tongue4), 0, y);
				tongue.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongue.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongueList.add(tongue);

			} else if (gen == 6) {

				Happy happy = new Happy(BitmapFactory.decodeResource(
						getResources(), R.drawable.happy4), aa, y);
				happy.getSpeed().toggleXDirection();
				happy.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happy.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happyList.add(happy);

			} else if (gen == 7) {

				Sad sad = new Sad(BitmapFactory.decodeResource(getResources(),
						R.drawable.sad4), aa, y);
				sad.getSpeed().toggleXDirection();
				sad.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sad.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sadList.add(sad);

			} else if (gen == 8) {

				Angry angry = new Angry(BitmapFactory.decodeResource(
						getResources(), R.drawable.angry4), aa, y);
				angry.getSpeed().toggleXDirection();
				angry.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angry.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angryList.add(angry);

			} else if (gen == 9) {

				Teeth teeth = new Teeth(BitmapFactory.decodeResource(
						getResources(), R.drawable.teeth4), aa, y);
				teeth.getSpeed().toggleXDirection();
				teeth.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teeth.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teethList.add(teeth);

			} else if (gen == 10) {

				Wink wink = new Wink(BitmapFactory.decodeResource(
						getResources(), R.drawable.wink4), aa, y);
				wink.getSpeed().toggleXDirection();
				wink.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				wink.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				winkList.add(wink);

			} else if (gen == 11) {

				Tongue tongue = new Tongue(BitmapFactory.decodeResource(
						getResources(), R.drawable.tongue4), aa, y);
				tongue.getSpeed().toggleXDirection();
				tongue.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongue.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongueList.add(tongue);

			} else if (gen == 12) {

				Happy happy = new Happy(BitmapFactory.decodeResource(
						getResources(), R.drawable.happy4), 0, y);
				happy.getSpeed().toggleYDirection();
				happy.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happy.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happyList.add(happy);

			} else if (gen == 13) {

				Sad sad = new Sad(BitmapFactory.decodeResource(getResources(),
						R.drawable.sad4), 0, y);
				sad.getSpeed().toggleYDirection();
				sad.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sad.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sadList.add(sad);

			} else if (gen == 14) {

				Angry angry = new Angry(BitmapFactory.decodeResource(
						getResources(), R.drawable.angry4), 0, y);
				angry.getSpeed().toggleYDirection();
				angry.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angry.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angryList.add(angry);

			} else if (gen == 15) {

				Teeth teeth = new Teeth(BitmapFactory.decodeResource(
						getResources(), R.drawable.teeth4), 0, y);
				teeth.getSpeed().toggleYDirection();
				teeth.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teeth.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teethList.add(teeth);

			} else if (gen == 16) {

				Wink wink = new Wink(BitmapFactory.decodeResource(
						getResources(), R.drawable.wink4), 0, y);
				wink.getSpeed().toggleYDirection();
				wink.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				wink.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				winkList.add(wink);

			} else if (gen == 17) {

				Tongue tongue = new Tongue(BitmapFactory.decodeResource(
						getResources(), R.drawable.tongue4), 0, y);
				tongue.getSpeed().toggleYDirection();
				tongue.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongue.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongueList.add(tongue);

			} else if (gen == 18) {

				Happy happy = new Happy(BitmapFactory.decodeResource(
						getResources(), R.drawable.happy4), aa, y);
				happy.getSpeed().toggleXDirection();
				happy.getSpeed().toggleYDirection();
				happy.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happy.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				happyList.add(happy);

			} else if (gen == 19) {

				Sad sad = new Sad(BitmapFactory.decodeResource(getResources(),
						R.drawable.sad4), aa, y);
				sad.getSpeed().toggleXDirection();
				sad.getSpeed().toggleYDirection();
				sad.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sad.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				sadList.add(sad);

			} else if (gen == 20) {

				Angry angry = new Angry(BitmapFactory.decodeResource(
						getResources(), R.drawable.angry4), aa, y);
				angry.getSpeed().toggleXDirection();
				angry.getSpeed().toggleYDirection();
				angry.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angry.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				angryList.add(angry);

			} else if (gen == 21) {

				Teeth teeth = new Teeth(BitmapFactory.decodeResource(
						getResources(), R.drawable.teeth4), aa, y);
				teeth.getSpeed().toggleXDirection();
				teeth.getSpeed().toggleYDirection();
				teeth.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teeth.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				teethList.add(teeth);

			} else if (gen == 22) {

				Wink wink = new Wink(BitmapFactory.decodeResource(
						getResources(), R.drawable.wink4), aa, y);
				wink.getSpeed().toggleXDirection();
				wink.getSpeed().toggleYDirection();
				wink.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				wink.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				winkList.add(wink);

			} else if (gen == 23) {

				Tongue tongue = new Tongue(BitmapFactory.decodeResource(
						getResources(), R.drawable.tongue4), aa, y);
				tongue.getSpeed().toggleXDirection();
				tongue.getSpeed().toggleYDirection();
				tongue.getSpeed().setXv(
						(float) (xvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongue.getSpeed().setYv(
						(float) (yvel * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				tongueList.add(tongue);

			} else if (gen == 24) {

				Bawling bawling = new Bawling(BitmapFactory.decodeResource(
						getResources(), R.drawable.bawling), 0, z1);
				bawling.getFastSpeed().setXv(
						(float) (fastSpeed * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				bawlingList.add(bawling);

			} else if (gen == 25) {

				Bawling bawling = new Bawling(BitmapFactory.decodeResource(
						getResources(), R.drawable.bawling), aa, z1);
				bawling.getFastSpeed().toggleXDirection();
				bawling.getFastSpeed().setXv(
						(float) (fastSpeed * Math.pow(SPEED_INCREASE_FACTOR,
								speedIncreaser)));
				bawlingList.add(bawling);

			}
		}

		try {

			// check collision with right wall if heading right
			for (int i = 0; i < happyList.size(); i++) {
				if (happyList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& happyList.get(i).getX()
								- happyList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					happyList.remove(i);
				}
				// check collision with left wall if heading left
				if (happyList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& happyList.get(i).getX()
								+ happyList.get(i).getBitmap().getWidth() / 2 <= 0) {
					happyList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (happyList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& happyList.get(i).getY()
								+ happyList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					happyList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (happyList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					happyList.get(i).getSpeed().toggleYDirection();
				}
			}
			// check collision with right wall if heading right
			for (int i = 0; i < sadList.size(); i++) {
				if (sadList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& sadList.get(i).getX()
								- sadList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					sadList.remove(i);
				}
				// check collision with left wall if heading left

				if (sadList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& sadList.get(i).getX()
								+ sadList.get(i).getBitmap().getWidth() / 2 <= 0) {
					sadList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (sadList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& sadList.get(i).getY()
								+ sadList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					sadList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (sadList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					sadList.get(i).getSpeed().toggleYDirection();
				}
			}
			// check collision with right wall if heading right
			for (int i = 0; i < angryList.size(); i++) {
				if (angryList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& angryList.get(i).getX()
								- angryList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					angryList.remove(i);
				}
				// check collision with left wall if heading left
				if (angryList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& angryList.get(i).getX()
								+ angryList.get(i).getBitmap().getWidth() / 2 <= 0) {
					angryList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (angryList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& angryList.get(i).getY()
								+ angryList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					angryList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (angryList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					angryList.get(i).getSpeed().toggleYDirection();
				}
			}
			// check collision with right wall if heading right
			for (int i = 0; i < teethList.size(); i++) {
				if (teethList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& teethList.get(i).getX()
								- teethList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					teethList.remove(i);
				}
				// check collision with left wall if heading left
				if (teethList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& teethList.get(i).getX()
								+ teethList.get(i).getBitmap().getWidth() / 2 <= 0) {
					teethList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (teethList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& teethList.get(i).getY()
								+ teethList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					teethList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (teethList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& teethList.get(i).getY()
								- teethList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					teethList.get(i).getSpeed().toggleYDirection();
				}
			}
			// check collision with right wall if heading right
			for (int i = 0; i < winkList.size(); i++) {
				if (winkList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& winkList.get(i).getX()
								- winkList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					winkList.remove(i);
				}
				// check collision with left wall if heading left
				if (winkList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& winkList.get(i).getX()
								+ winkList.get(i).getBitmap().getWidth() / 2 <= 0) {
					winkList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (winkList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& winkList.get(i).getY()
								+ winkList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					winkList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (winkList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& winkList.get(i).getY()
								- winkList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					winkList.get(i).getSpeed().toggleYDirection();
				}
			}
			// check collision with right wall if heading right
			for (int i = 0; i < tongueList.size(); i++) {
				if (tongueList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_RIGHT
						&& tongueList.get(i).getX()
								- tongueList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					tongueList.remove(i);
				}
				// check collision with left wall if heading left
				if (tongueList.get(i).getSpeed().getxDirection() == Speed.DIRECTION_LEFT
						&& tongueList.get(i).getX()
								+ tongueList.get(i).getBitmap().getWidth() / 2 <= 0) {
					tongueList.remove(i);
				}
				// check collision with bottom wall if heading down
				if (tongueList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_DOWN
						&& tongueList.get(i).getY()
								+ tongueList.get(i).getBitmap().getHeight() / 2 >= getHeight()) {
					tongueList.get(i).getSpeed().toggleYDirection();
				}
				// check collision with top wall if heading up
				if (tongueList.get(i).getSpeed().getyDirection() == Speed.DIRECTION_UP
						&& tongueList.get(i).getY()
								- tongueList.get(i).getBitmap().getHeight() / 2 <= getHeight() / 8) {
					tongueList.get(i).getSpeed().toggleYDirection();
				}
			}
			for (int i = 0; i < bawlingList.size(); i++) {
				if (bawlingList.get(i).getFastSpeed().getxDirection() == FastSpeed.DIRECTION_RIGHT
						&& bawlingList.get(i).getX()
								- bawlingList.get(i).getBitmap().getWidth() / 2 >= getWidth()) {
					bawlingList.remove(i);
				}
				if (bawlingList.get(i).getFastSpeed().getxDirection() == FastSpeed.DIRECTION_LEFT
						&& bawlingList.get(i).getX()
								+ bawlingList.get(i).getBitmap().getWidth() / 2 <= 0) {
					bawlingList.remove(i);
				}
			}

			// happy-happy collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < happyList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < happyList
							.get(j).getX()
							+ happyList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > happyList.get(j).getX()
									- happyList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < happyList
								.get(j).getY()
								+ happyList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > happyList
										.get(j).getY()
										- happyList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (happyList.get(i).getX() < happyList.get(i)
										.getBitmap().getWidth()
										&& happyList.get(j).getX() < happyList
												.get(j).getBitmap().getWidth()) {
								} else {
									happyList.get(i).getSpeed()
											.toggleXDirection();
									happyList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// happy-sad collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < sadList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < sadList
							.get(j).getX()
							+ sadList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > sadList.get(j).getX()
									- sadList.get(j).getBitmap().getWidth() / 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < sadList
								.get(j).getY()
								+ sadList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > sadList.get(
										j).getY()
										- sadList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((happyList.get(i).getY() - happyList
									.get(i).getBitmap().getHeight() / 2)
									- (sadList.get(j).getY() + sadList.get(j)
											.getBitmap().getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								sadList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getY() + happyList
											.get(i).getBitmap().getHeight() / 2)
											- (sadList.get(j).getY() - sadList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								sadList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getX() - happyList
											.get(i).getBitmap().getWidth() / 2)
											- (sadList.get(j).getX() + sadList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								sadList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((happyList.get(i).getX() + happyList
											.get(i).getBitmap().getWidth() / 2)
											- (sadList.get(j).getX() - sadList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								sadList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// happy-angry collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < angryList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < angryList
							.get(j).getX()
							+ angryList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > angryList.get(j).getX()
									- angryList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < angryList
								.get(j).getY()
								+ angryList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > angryList
										.get(j).getY()
										- angryList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((happyList.get(i).getY() - happyList
									.get(i).getBitmap().getHeight() / 2)
									- (angryList.get(j).getY() + angryList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								angryList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getY() + happyList
											.get(i).getBitmap().getHeight() / 2)
											- (angryList.get(j).getY() - angryList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								angryList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getX() - happyList
											.get(i).getBitmap().getWidth() / 2)
											- (angryList.get(j).getX() + angryList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								angryList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((happyList.get(i).getX() + happyList
											.get(i).getBitmap().getWidth() / 2)
											- (angryList.get(j).getX() - angryList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								angryList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// happy-teeth collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < teethList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < teethList
							.get(j).getX()
							+ teethList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > teethList.get(j).getX()
									- teethList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < teethList
								.get(j).getY()
								+ teethList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > teethList
										.get(j).getY()
										- teethList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((happyList.get(i).getY() - happyList
									.get(i).getBitmap().getHeight() / 2)
									- (teethList.get(j).getY() + teethList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getY() + happyList
											.get(i).getBitmap().getHeight() / 2)
											- (teethList.get(j).getY() - teethList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getX() - happyList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() + teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((happyList.get(i).getX() + happyList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() - teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// happy-wink collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < winkList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < winkList
							.get(j).getX()
							+ winkList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > winkList.get(j).getX()
									- winkList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < winkList
								.get(j).getY()
								+ winkList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > winkList
										.get(j).getY()
										- winkList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((happyList.get(i).getY() - happyList
									.get(i).getBitmap().getHeight() / 2)
									- (winkList.get(j).getY() + winkList.get(j)
											.getBitmap().getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getY() + happyList
											.get(i).getBitmap().getHeight() / 2)
											- (winkList.get(j).getY() - winkList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getX() - happyList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() + winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((happyList.get(i).getX() + happyList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() - winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// happy-tongue collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > tongueList.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((happyList.get(i).getY() - happyList
									.get(i).getBitmap().getHeight() / 2)
									- (tongueList.get(j).getY() + tongueList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getY() + happyList
											.get(i).getBitmap().getHeight() / 2)
											- (tongueList.get(j).getY() - tongueList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((happyList.get(i).getX() - happyList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() + tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((happyList.get(i).getX() + happyList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() - tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								happyList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// happy-bawling collisions
			for (int i = 0; i < happyList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (happyList.get(i).getX()
							- happyList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& happyList.get(i).getX()
									+ happyList.get(i).getBitmap().getWidth()
									/ 2 > bawlingList.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (happyList.get(i).getY()
								- happyList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& happyList.get(i).getY()
										+ happyList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							happyList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

			// sad-sad collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < sadList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < sadList
							.get(j).getX()
							+ sadList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > sadList
									.get(j).getX()
									- sadList.get(j).getBitmap().getWidth() / 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < sadList
								.get(j).getY()
								+ sadList.get(j).getBitmap().getHeight() / 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > sadList.get(
										j).getY()
										- sadList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (sadList.get(i).getX() < sadList.get(i)
										.getBitmap().getWidth()
										&& sadList.get(j).getX() < sadList
												.get(j).getBitmap().getWidth()) {
								} else {
									sadList.get(i).getSpeed()
											.toggleXDirection();
									sadList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// sad-angry collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < angryList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < angryList
							.get(j).getX()
							+ angryList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > angryList
									.get(j).getX()
									- angryList.get(j).getBitmap().getWidth()
									/ 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < angryList
								.get(j).getY()
								+ angryList.get(j).getBitmap().getHeight() / 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > angryList
										.get(j).getY()
										- angryList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((sadList.get(i).getY() - sadList
									.get(i).getBitmap().getHeight() / 2)
									- (angryList.get(j).getY() + angryList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								angryList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getY() + sadList
											.get(i).getBitmap().getHeight() / 2)
											- (angryList.get(j).getY() - angryList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								angryList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getX() - sadList
											.get(i).getBitmap().getWidth() / 2)
											- (angryList.get(j).getX() + angryList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								angryList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((sadList.get(i).getX() + sadList
											.get(i).getBitmap().getWidth() / 2)
											- (angryList.get(j).getX() - angryList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								angryList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// sad-teeth collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < teethList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < teethList
							.get(j).getX()
							+ teethList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > teethList
									.get(j).getX()
									- teethList.get(j).getBitmap().getWidth()
									/ 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < teethList
								.get(j).getY()
								+ teethList.get(j).getBitmap().getHeight() / 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > teethList
										.get(j).getY()
										- teethList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((sadList.get(i).getY() - sadList
									.get(i).getBitmap().getHeight() / 2)
									- (teethList.get(j).getY() + teethList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getY() + sadList
											.get(i).getBitmap().getHeight() / 2)
											- (teethList.get(j).getY() - teethList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getX() - sadList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() + teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((sadList.get(i).getX() + sadList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() - teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// sad-wink collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < winkList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < winkList
							.get(j).getX()
							+ winkList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > winkList
									.get(j).getX()
									- winkList.get(j).getBitmap().getWidth()
									/ 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < winkList
								.get(j).getY()
								+ winkList.get(j).getBitmap().getHeight() / 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > winkList
										.get(j).getY()
										- winkList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((sadList.get(i).getY() - sadList
									.get(i).getBitmap().getHeight() / 2)
									- (winkList.get(j).getY() + winkList.get(j)
											.getBitmap().getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getY() + sadList
											.get(i).getBitmap().getHeight() / 2)
											- (winkList.get(j).getY() - winkList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getX() - sadList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() + winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((sadList.get(i).getX() + sadList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() - winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// sad-tongue collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > tongueList
									.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((sadList.get(i).getY() - sadList
									.get(i).getBitmap().getHeight() / 2)
									- (tongueList.get(j).getY() + tongueList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getY() + sadList
											.get(i).getBitmap().getHeight() / 2)
											- (tongueList.get(j).getY() - tongueList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((sadList.get(i).getX() - sadList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() + tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((sadList.get(i).getX() + sadList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() - tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								sadList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// sad-bawling collisions
			for (int i = 0; i < sadList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (sadList.get(i).getX()
							- sadList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& sadList.get(i).getX()
									+ sadList.get(i).getBitmap().getWidth() / 2 > bawlingList
									.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (sadList.get(i).getY()
								- sadList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& sadList.get(i).getY()
										+ sadList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							sadList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

			// angry-angry collisions
			for (int i = 0; i < angryList.size(); i++) {
				for (int j = 0; j < angryList.size(); j++) {
					if (angryList.get(i).getX()
							- angryList.get(i).getBitmap().getWidth() / 2 < angryList
							.get(j).getX()
							+ angryList.get(j).getBitmap().getWidth() / 2
							&& angryList.get(i).getX()
									+ angryList.get(i).getBitmap().getWidth()
									/ 2 > angryList.get(j).getX()
									- angryList.get(j).getBitmap().getWidth()
									/ 2) {
						if (angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 < angryList
								.get(j).getY()
								+ angryList.get(j).getBitmap().getHeight() / 2
								&& angryList.get(i).getY()
										+ angryList.get(i).getBitmap()
												.getHeight() / 2 > angryList
										.get(j).getY()
										- angryList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (angryList.get(i).getX() < angryList.get(i)
										.getBitmap().getWidth()
										&& angryList.get(j).getX() < angryList
												.get(j).getBitmap().getWidth()) {
								} else {
									angryList.get(i).getSpeed()
											.toggleXDirection();
									angryList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// angry-teeth collisions
			for (int i = 0; i < angryList.size(); i++) {
				for (int j = 0; j < teethList.size(); j++) {
					if (angryList.get(i).getX()
							- angryList.get(i).getBitmap().getWidth() / 2 < teethList
							.get(j).getX()
							+ teethList.get(j).getBitmap().getWidth() / 2
							&& angryList.get(i).getX()
									+ angryList.get(i).getBitmap().getWidth()
									/ 2 > teethList.get(j).getX()
									- teethList.get(j).getBitmap().getWidth()
									/ 2) {
						if (angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 < teethList
								.get(j).getY()
								+ teethList.get(j).getBitmap().getHeight() / 2
								&& angryList.get(i).getY()
										+ angryList.get(i).getBitmap()
												.getHeight() / 2 > teethList
										.get(j).getY()
										- teethList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((angryList.get(i).getY() - angryList
									.get(i).getBitmap().getHeight() / 2)
									- (teethList.get(j).getY() + teethList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getY() + angryList
											.get(i).getBitmap().getHeight() / 2)
											- (teethList.get(j).getY() - teethList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								teethList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getX() - angryList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() + teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((angryList.get(i).getX() + angryList
											.get(i).getBitmap().getWidth() / 2)
											- (teethList.get(j).getX() - teethList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								teethList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// angry-wink collisions
			for (int i = 0; i < angryList.size(); i++) {
				for (int j = 0; j < winkList.size(); j++) {
					if (angryList.get(i).getX()
							- angryList.get(i).getBitmap().getWidth() / 2 < winkList
							.get(j).getX()
							+ winkList.get(j).getBitmap().getWidth() / 2
							&& angryList.get(i).getX()
									+ angryList.get(i).getBitmap().getWidth()
									/ 2 > winkList.get(j).getX()
									- winkList.get(j).getBitmap().getWidth()
									/ 2) {
						if (angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 < winkList
								.get(j).getY()
								+ winkList.get(j).getBitmap().getHeight() / 2
								&& angryList.get(i).getY()
										+ angryList.get(i).getBitmap()
												.getHeight() / 2 > winkList
										.get(j).getY()
										- winkList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((angryList.get(i).getY() - angryList
									.get(i).getBitmap().getHeight() / 2)
									- (winkList.get(j).getY() + winkList.get(j)
											.getBitmap().getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getY() + angryList
											.get(i).getBitmap().getHeight() / 2)
											- (winkList.get(j).getY() - winkList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getX() - angryList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() + winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((angryList.get(i).getX() + angryList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() - winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// angry-tongue collisions
			for (int i = 0; i < angryList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (angryList.get(i).getX()
							- angryList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& angryList.get(i).getX()
									+ angryList.get(i).getBitmap().getWidth()
									/ 2 > tongueList.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& angryList.get(i).getY()
										+ angryList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((angryList.get(i).getY() - angryList
									.get(i).getBitmap().getHeight() / 2)
									- (tongueList.get(j).getY() + tongueList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getY() + angryList
											.get(i).getBitmap().getHeight() / 2)
											- (tongueList.get(j).getY() - tongueList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((angryList.get(i).getX() - angryList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() + tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((angryList.get(i).getX() + angryList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() - tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								angryList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// angry-bawling collisions
			for (int i = 0; i < angryList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (angryList.get(i).getX()
							- angryList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& angryList.get(i).getX()
									+ angryList.get(i).getBitmap().getWidth()
									/ 2 > bawlingList.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (angryList.get(i).getY()
								- angryList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& angryList.get(i).getY()
										+ angryList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							angryList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

			// teeth-teeth collisions
			for (int i = 0; i < teethList.size(); i++) {
				for (int j = 0; j < teethList.size(); j++) {
					if (teethList.get(i).getX()
							- teethList.get(i).getBitmap().getWidth() / 2 < teethList
							.get(j).getX()
							+ teethList.get(j).getBitmap().getWidth() / 2
							&& teethList.get(i).getX()
									+ teethList.get(i).getBitmap().getWidth()
									/ 2 > teethList.get(j).getX()
									- teethList.get(j).getBitmap().getWidth()
									/ 2) {
						if (teethList.get(i).getY()
								- teethList.get(i).getBitmap().getHeight() / 2 < teethList
								.get(j).getY()
								+ teethList.get(j).getBitmap().getHeight() / 2
								&& teethList.get(i).getY()
										+ teethList.get(i).getBitmap()
												.getHeight() / 2 > teethList
										.get(j).getY()
										- teethList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (teethList.get(i).getX() < teethList.get(i)
										.getBitmap().getWidth()
										&& teethList.get(j).getX() < teethList
												.get(j).getBitmap().getWidth()) {
								} else {
									teethList.get(i).getSpeed()
											.toggleXDirection();
									teethList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// teeth-wink collisions
			for (int i = 0; i < teethList.size(); i++) {
				for (int j = 0; j < winkList.size(); j++) {
					if (teethList.get(i).getX()
							- teethList.get(i).getBitmap().getWidth() / 2 < winkList
							.get(j).getX()
							+ winkList.get(j).getBitmap().getWidth() / 2
							&& teethList.get(i).getX()
									+ teethList.get(i).getBitmap().getWidth()
									/ 2 > winkList.get(j).getX()
									- winkList.get(j).getBitmap().getWidth()
									/ 2) {
						if (teethList.get(i).getY()
								- teethList.get(i).getBitmap().getHeight() / 2 < winkList
								.get(j).getY()
								+ winkList.get(j).getBitmap().getHeight() / 2
								&& teethList.get(i).getY()
										+ teethList.get(i).getBitmap()
												.getHeight() / 2 > winkList
										.get(j).getY()
										- winkList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((teethList.get(i).getY() - teethList
									.get(i).getBitmap().getHeight() / 2)
									- (winkList.get(j).getY() + winkList.get(j)
											.getBitmap().getHeight() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((teethList.get(i).getY() + teethList
											.get(i).getBitmap().getHeight() / 2)
											- (winkList.get(j).getY() - winkList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleYDirection();
								winkList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((teethList.get(i).getX() - teethList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() + winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((teethList.get(i).getX() + teethList
											.get(i).getBitmap().getWidth() / 2)
											- (winkList.get(j).getX() - winkList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleXDirection();
								winkList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// teeth-tongue collisions
			for (int i = 0; i < teethList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (teethList.get(i).getX()
							- teethList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& teethList.get(i).getX()
									+ teethList.get(i).getBitmap().getWidth()
									/ 2 > tongueList.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (teethList.get(i).getY()
								- teethList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& teethList.get(i).getY()
										+ teethList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((teethList.get(i).getY() - teethList
									.get(i).getBitmap().getHeight() / 2)
									- (tongueList.get(j).getY() + tongueList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((teethList.get(i).getY() + teethList
											.get(i).getBitmap().getHeight() / 2)
											- (tongueList.get(j).getY() - tongueList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((teethList.get(i).getX() - teethList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() + tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((teethList.get(i).getX() + teethList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() - tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								teethList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// teeth-bawling collisions
			for (int i = 0; i < teethList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (teethList.get(i).getX()
							- teethList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& teethList.get(i).getX()
									+ teethList.get(i).getBitmap().getWidth()
									/ 2 > bawlingList.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (teethList.get(i).getY()
								- teethList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& teethList.get(i).getY()
										+ teethList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							teethList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

			// wink-wink collisions
			for (int i = 0; i < winkList.size(); i++) {
				for (int j = 0; j < winkList.size(); j++) {
					if (winkList.get(i).getX()
							- winkList.get(i).getBitmap().getWidth() / 2 < winkList
							.get(j).getX()
							+ winkList.get(j).getBitmap().getWidth() / 2
							&& winkList.get(i).getX()
									+ winkList.get(i).getBitmap().getWidth()
									/ 2 > winkList.get(j).getX()
									- winkList.get(j).getBitmap().getWidth()
									/ 2) {
						if (winkList.get(i).getY()
								- winkList.get(i).getBitmap().getHeight() / 2 < winkList
								.get(j).getY()
								+ winkList.get(j).getBitmap().getHeight() / 2
								&& winkList.get(i).getY()
										+ winkList.get(i).getBitmap()
												.getHeight() / 2 > winkList
										.get(j).getY()
										- winkList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (winkList.get(i).getX() < winkList.get(i)
										.getBitmap().getWidth()
										&& winkList.get(j).getX() < winkList
												.get(j).getBitmap().getWidth()) {
								} else {
									winkList.get(i).getSpeed()
											.toggleXDirection();
									winkList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// wink-tongue collisions
			for (int i = 0; i < winkList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (winkList.get(i).getX()
							- winkList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& winkList.get(i).getX()
									+ winkList.get(i).getBitmap().getWidth()
									/ 2 > tongueList.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (winkList.get(i).getY()
								- winkList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& winkList.get(i).getY()
										+ winkList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (Math.abs((winkList.get(i).getY() - winkList
									.get(i).getBitmap().getHeight() / 2)
									- (tongueList.get(j).getY() + tongueList
											.get(j).getBitmap().getHeight() / 2)) < 6) {
								winkList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((winkList.get(i).getY() + winkList
											.get(i).getBitmap().getHeight() / 2)
											- (tongueList.get(j).getY() - tongueList
													.get(j).getBitmap()
													.getHeight() / 2)) < 6) {
								winkList.get(i).getSpeed().toggleYDirection();
								tongueList.get(j).getSpeed().toggleYDirection();
							} else if (Math
									.abs((winkList.get(i).getX() - winkList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() + tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								winkList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							} else if (Math
									.abs((winkList.get(i).getX() + winkList
											.get(i).getBitmap().getWidth() / 2)
											- (tongueList.get(j).getX() - tongueList
													.get(j).getBitmap()
													.getWidth() / 2)) < 6) {
								winkList.get(i).getSpeed().toggleXDirection();
								tongueList.get(j).getSpeed().toggleXDirection();
							}
						}
					}
				}
			}

			// wink-bawling collisions
			for (int i = 0; i < winkList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (winkList.get(i).getX()
							- winkList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& winkList.get(i).getX()
									+ winkList.get(i).getBitmap().getWidth()
									/ 2 > bawlingList.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (winkList.get(i).getY()
								- winkList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& winkList.get(i).getY()
										+ winkList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							winkList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

			// tongue-tongue collisions
			for (int i = 0; i < tongueList.size(); i++) {
				for (int j = 0; j < tongueList.size(); j++) {
					if (tongueList.get(i).getX()
							- tongueList.get(i).getBitmap().getWidth() / 2 < tongueList
							.get(j).getX()
							+ tongueList.get(j).getBitmap().getWidth() / 2
							&& tongueList.get(i).getX()
									+ tongueList.get(i).getBitmap().getWidth()
									/ 2 > tongueList.get(j).getX()
									- tongueList.get(j).getBitmap().getWidth()
									/ 2) {
						if (tongueList.get(i).getY()
								- tongueList.get(i).getBitmap().getHeight() / 2 < tongueList
								.get(j).getY()
								+ tongueList.get(j).getBitmap().getHeight() / 2
								&& tongueList.get(i).getY()
										+ tongueList.get(i).getBitmap()
												.getHeight() / 2 > tongueList
										.get(j).getY()
										- tongueList.get(j).getBitmap()
												.getHeight() / 2) {
							if (i != j) {
								if (tongueList.get(i).getX() < tongueList
										.get(i).getBitmap().getWidth()
										&& tongueList.get(j).getX() < tongueList
												.get(j).getBitmap().getWidth()) {
								} else {
									tongueList.get(i).getSpeed()
											.toggleXDirection();
									tongueList.get(j).getSpeed()
											.toggleYDirection();
								}
							}
						}
					}
				}
			}

			// tongue-bawling collisions
			for (int i = 0; i < tongueList.size(); i++) {
				for (int j = 0; j < bawlingList.size(); j++) {
					if (tongueList.get(i).getX()
							- tongueList.get(i).getBitmap().getWidth() / 2 < bawlingList
							.get(j).getX()
							+ bawlingList.get(j).getBitmap().getWidth() / 2
							&& tongueList.get(i).getX()
									+ tongueList.get(i).getBitmap().getWidth()
									/ 2 > bawlingList.get(j).getX()
									- bawlingList.get(j).getBitmap().getWidth()
									/ 2) {
						if (tongueList.get(i).getY()
								- tongueList.get(i).getBitmap().getHeight() / 2 < bawlingList
								.get(j).getY()
								+ bawlingList.get(j).getBitmap().getHeight()
								/ 2
								&& tongueList.get(i).getY()
										+ tongueList.get(i).getBitmap()
												.getHeight() / 2 > bawlingList
										.get(j).getY()
										- bawlingList.get(j).getBitmap()
												.getHeight() / 2) {
							tongueList.get(i).getSpeed().toggleXDirection();
						}
					}
				}
			}

		} catch (IndexOutOfBoundsException e) {

		} catch (NullPointerException e) {

		}

		// Update the smilies

		try {
			Iterator<Happy> iter = happyList.iterator();
			while (iter.hasNext()) {
				iter.next().update();
			}
			Iterator<Sad> iter1 = sadList.iterator();
			while (iter1.hasNext()) {
				iter1.next().update();
			}
			Iterator<Angry> iter2 = angryList.iterator();
			while (iter2.hasNext()) {
				iter2.next().update();
			}
			Iterator<Teeth> iter3 = teethList.iterator();
			while (iter3.hasNext()) {
				iter3.next().update();
			}
			Iterator<Wink> iter4 = winkList.iterator();
			while (iter4.hasNext()) {
				iter4.next().update();
			}
			Iterator<Tongue> iter5 = tongueList.iterator();
			while (iter5.hasNext()) {
				iter5.next().update();
			}
			Iterator<Bawling> iter6 = bawlingList.iterator();
			while (iter6.hasNext()) {
				iter6.next().update();
			}

		} catch (IndexOutOfBoundsException e) {

		} catch (NullPointerException e) {

		} catch (ConcurrentModificationException e) {

		}

	}

}
